import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

class IntCmp1 implements Comparator<Integer> {
    @Override
    public int compare(Integer o1, Integer o2) {
        return o2 - o1;
    }
}

public class d3t31 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        String[] sarr = s.split(" ");
        int n = Integer.parseInt(sarr[0]);
        int k = Integer.parseInt(sarr[1]);

        int j = 0, sum = 0;

        PriorityQueue<Integer> p = new PriorityQueue<>(new IntCmp1()); //创建大根堆将进行排序
        for (int i = 0; i < n; i++) {
            p.offer(scanner.nextInt());
        }
        int[] arr = new int[n];

        while (j < k) {
            for (int i = 0; i < n; i++) {
                arr[i] = p.poll();
                if (arr[i] % 2 == 0) {
                    arr[i] /= 2;
                    j++;
                    //每/2一次就要重排序一次数组元素
                    break;
                }

            }

            p = new PriorityQueue<>(new IntCmp1()); //创建大根堆将进行排序
            for (int i = 0; i < n; i++) {
                p.offer(arr[i]);
            }
        }

        for (int i = 0; i < n; i++) {
            sum+=arr[i];
        }
        System.out.println(sum);
    }
}
